# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=farbfeld
pkgver=4
pkgrel=2
pkgdesc="Lossless image format which is easy to parse, pipe and compress"
url="https://tools.suckless.org/farbfeld/"
arch="all"
license="ISC"
depends="file"
makedepends="libpng-dev libjpeg-turbo-dev"
options="!check"
subpackages="$pkgname-doc"
source="https://dl.suckless.org/$pkgname/$pkgname-$pkgver.tar.gz"

prepare() {
	default_prepare
	sed -i -e '/CFLAGS/{s/-Os//;s/=/+=/}' \
		-e '/^LDFLAGS  = -s$/d' \
		-e 's|/usr/local|/usr|g' \
		"$builddir"/config.mk
}

build() {
	make -C "$builddir"
}

package() {
	make DESTDIR="$pkgdir" PREFIX=/usr install

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname/
	install -m644 README FORMAT \
		"$pkgdir"/usr/share/doc/$pkgname/
}

sha512sums="5139dd81cf1e3cb7a32108c0acad0e4ae0de13e86b997f1a759aa1b1f7be6c1ad2a93a69af7126e3512a7c9b1669a2a301ff60171b098b3450f1da0594e3b6ac  farbfeld-4.tar.gz"
